/* ==========================================================================
   Variables et Styles Globaux (Thème "Héritage & Nature")
   ========================================================================== */
:root {
    /* Typographie */
    --font-title: 'Lora', serif;
    --font-body: 'Lato', sans-serif;

    /* Palette de couleurs */
    --color-bg: #F9F7F3;          /* Blanc cassé/Crème pour le fond */
    --color-text: #333333;        /* Gris anthracite lisible */
    --color-primary: #2A4B3A;     /* Vert forêt (nature, sérieux) */
    --color-primary-light: #3A634D;
    --color-secondary: #EAE0D1;   /* Beige sable (cartes, accents) */
    --color-accent: #B8860B;      /* Ocre/Doré (liens, boutons) */
    --color-accent-hover: #9B7008;
    --color-white: #FFFFFF;
    --color-border: #E0D8C8;      /* Bordure douce */
    
    /* Espacements et Ombres */
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.08);
    --radius-card: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Typographie Fluide (S'adapte automatiquement à l'écran)
   ========================================================================== */
h1, h2, h3, h4 {
    font-family: var(--font-title);
    color: var(--color-primary);
    margin-bottom: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p { margin-bottom: 1.2rem; }
ul { list-style-position: outside; margin-bottom: 1.2rem; margin-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* ==========================================================================
   En-tête (Header)
   ========================================================================== */
.site-header {
    padding: 1.5rem 0;
    text-align: center;
    background-color: var(--color-bg);
}

.header-banner {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.hamburger {
    display: none;
}

/* ==========================================================================
   Navigation Principale
   ========================================================================== */
.main-nav {
    background-color: var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.main-nav .container > ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.main-nav li {
    position: relative;
    margin: 0;
}

.main-nav > .container > ul > li > a {
    display: block;
    color: var(--color-white);
    padding: 1.2rem 1.5rem;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.main-nav li:hover > a {
    background-color: var(--color-primary-light);
    text-decoration: none;
}

/* Menu Déroulant (Desktop) */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 260px;
    box-shadow: var(--shadow-hover);
    border-radius: 0 0 8px 8px;
    margin: 0;
}

.dropdown li a {
    color: var(--color-text);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    display: block;
    transition: background-color 0.2s;
}

.dropdown li a:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    text-decoration: none;
}

.main-nav li:hover > .dropdown {
    display: block;
}

/* ==========================================================================
   Mise en page Principale (Main Layout)
   ========================================================================== */
.main-content {
    display: flex;
    gap: 2.5rem;
    padding: 3rem 0;
    align-items: flex-start;
}

.content-column {
    flex: 2; /* 66% de la largeur */
    min-width: 0; /* Empêche le débordement sur petits écrans */
}

.sidebar-column {
    flex: 1; /* 33% de la largeur */
    min-width: 0;
}

/* ==========================================================================
   Cartes (Cards) - Le coeur du design
   ========================================================================== */
.card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* Gère les flottants internes */
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.card > *:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Images & Éléments spécifiques
   ========================================================================== */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.float-left {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 150px;
}

.float-right {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 150px;
}

.small-img { max-width: 120px; }
.full-width-image { width: 100%; margin-bottom: 1.5rem; }

.signature {
    text-align: right;
    font-style: italic;
    color: #666;
    margin-top: 2rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

/* Boutons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.8rem 1.8rem;
    border-radius: 30px; /* Boutons arrondis élégants */
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid var(--color-primary);
}

.button:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
    text-decoration: none;
}

/* ==========================================================================
   Pied de Page (Footer)
   ========================================================================== */
.site-footer {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    padding: 3rem 0;
    text-align: center;
    border-top: 5px solid var(--color-accent);
}

.site-footer h3 {
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.site-footer p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.footer-links, .footer-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

.footer-links a, .footer-actions a {
    color: var(--color-white);
    font-weight: 400;
}

.footer-links a:hover, .footer-actions a:hover {
    color: var(--color-accent);
}

.footer-links span {
    color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablettes & Mobiles)
   ========================================================================== */

/* Tablettes (Paysage et petit bureau) */
@media (max-width: 992px) {
    .main-content {
        gap: 1.5rem;
    }
    .card {
        padding: 2rem;
    }
}

/* Mobiles (Smartphones) */
@media (max-width: 768px) {
    
    /* Passage à une seule colonne */
    .main-content {
        flex-direction: column;
        padding: 1.5rem 0;
    }

    /* Ajustement des cartes pour mobile */
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    
    
    /* Indicateur de sous-menu pour mobile (via pseudo-element css) */
    .main-nav > .container > ul > li > a::after {
        content: '▼';
        font-size: 0.7rem;
        opacity: 0.7;
    }

/* --- NOUVELLE NAVIGATION MOBILE (Hamburger) --- */
    .main-nav .container {
        display: flex;
        justify-content: flex-end; /* Aligne le bouton hamburger à droite */
        align-items: center;
        padding: 10px 0; 
    }

    /* Style du bouton Hamburger */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 35px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 101;
        margin-right: 10px;
    }

    .hamburger span {
        width: 100%;
        height: 3px;
        background: var(--color-white);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* Animation du hamburger en croix quand il est ouvert */
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(40deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-40deg); }

    /* Le menu principal (masqué par défaut, s'affiche en superposition) */
    .main-nav > .container > ul {
        display: none; /* Masqué par défaut */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; /* S'attache juste en dessous de la barre de navigation */
        left: 0;
        background-color: var(--color-primary);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    /* Classe active pour afficher le menu principal */
    .main-nav > .container > ul.active {
        display: flex;
    }
    
    .main-nav li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .main-nav > .container > ul > li > a {
        padding: 1rem 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Indicateur de sous-menu (la petite flèche) */
    .main-nav > .container > ul > li > a::after {
        content: '▼';
        font-size: 0.7rem;
        opacity: 0.7;
        transition: transform 0.3s ease;
    }

    /* Rotation de la flèche quand le sous-menu est ouvert */
    .main-nav > .container > ul > li > a.submenu-open::after {
        transform: rotate(180deg);
    }

    /* Remplacement du survol (:hover) par un déclenchement au clic sur mobile */
    .main-nav li:hover > .dropdown {
        display: none; /* Désactive l'ouverture auto qui bug sur tactile */
    }

    /* Les sous-menus (masqués par défaut) */
	.dropdown {
        position: static !important; /* Annule le positionnement absolu PC */
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background-color: var(--color-primary-light) !important;
        padding: 0 !important;
        
        /* CORRECTION DU BUG D'AFFICHAGE : */
        display: none !important;    /* Utilise display pour masquer */
        opacity: 1 !important;        /* Force l'opacité à 1 pour éviter le bug de transparence */
        visibility: visible !important; /* Force la visibilité */
        transform: none !important;   /* Annule les animations de glissement PC */
    }

    /* Classe appliquée par JavaScript pour afficher le sous-menu instantanément */
    .dropdown.open {
        display: block !important;
    }
    
    .dropdown li a {
        color: var(--color-white);
        padding: 0.8rem 1.5rem 0.8rem 2.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown li a:hover {
        background-color: var(--color-primary);
        color: var(--color-accent);
    }

    /* Gestion des Images sur Mobile : On annule les flottants */
    .float-left, .float-right {
        float: none;
        display: block;
        margin: 0 auto 1.5rem auto;
        max-width: 200px; /* Taille contrôlée au centre */
        text-align: center;
    }

    /* Titres avec icônes (ex: Musée virtuel) : on passe en colonne */
    h1[style*="display: flex"], h2[style*="display: flex"], h3[style*="display: flex"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* Boutons en pleine largeur sur mobile */
    .button-group {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
        text-align: center;
    }

    /* Footer sur mobile */
    .footer-links span {
        display: none; /* Cache les barres de séparation | */
    }
    .footer-links, .footer-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
}